An entity, such as an application or a device, can be configured to discover that an event of interest has occurred, such as a change in the status of another application or device. Further, the entity can take an appropriate action in response to the occurrence of the event of interest. As a result, the entity can be configured to automatically perform one or more actions in response to a state of an application or a device. For example, the entity can download and install a software patch in response to discovering that the software patch has been made available on an accessible server.
An entity can determine whether an event of interest has occurred by polling a corresponding event provider. For example, a change in the state of the event provider being polled can be interpreted as the occurrence of an event of interest. Through polling, the entity actively transmits one or more requests for information to the event provider. The event provider then responds with the requested information. Further, the polling can be performed periodically, such as at a predetermined interval. Thus, an event of interest can be detected within a predetermined amount of time after occurrence. Polling also can be performed in response to the occurrence of another event.
The occurrence of an event of interest also can be discovered through receipt of a notification message. The notification message can be sent directly from the event provider to the entity to indicate that an event of interest has occurred. In order to receive direct notification, however, the entity must be known to the event provider. Thus, the entity must register with each event provider from which notification messages are desired.
Alternatively, one or more notification messages can be distributed in accordance with a publish-subscribe model. In a publish-subscribe model, an event provider (or “publisher”) publishes information to a notification service indicating that an event of interest has occurred. Further, the notification service can generate and transmit a corresponding event notification message to one or more entities (or “subscribers”) that have subscribed to receive notification messages associated with the event of interest. In a publish-subscribe model, each of the subscribers registers with the notification service to receive messages corresponding to one or more nodes (or “topics”). Generally, a message associated with the publish-subscribe model can include a payload of data, such as additional data that provides history or contextual information. A notification message, however, can be formatted to omit the payload of data. Thus, a notification message can indicate the occurrence of an event of interest without the additional overhead and processing associated with a typical message in the publish-subscribe model.
A notification service can include multiple nodes (or “topics”), to which one or more publishers can publish information regarding events of interest. Multiple subscribers also can subscribe to notification messages associated with a particular node. Thus, a notification service can broadcast a notification message associated with a single publisher to multiple subscribers. Further, a subscriber can subscribe to event notifications associated with multiple publishers. Additionally, a notification service can be configured to manage access to the notification system by both publishers and subscribers. For example, the notification service can maintain subscription lists, authenticate publishers and subscribers that are requesting to open a session, and manage nodes to which information can be published.
The publish-subscriber model has been implemented to notify subscribers of a variety of events. For example, network accessible content sites, such as news sites and weblogs, commonly implement the publish-subscribe model to notify subscribers of new content. When a new item of content is available on the content site, a publisher associated with the content site can publish information to a corresponding node hosted at a notification service. The notification service can then transmit an event notification message to each of the subscribers subscribing to that node.